<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
<link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
<script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
</head>
<body class="mxc-page">
<form name="myform" method="post" id="myform">
  <input type='hidden' id='id' value='{$object.bankId}'/>
  <table class="table table-hover table-striped table-bordered mxc-form">
    <tr>
      <td><span style='font-weight:bold;'>订单号：{$object['orderNo']}</span> <span style='margin-left:100px;'> 状态：
           <if condition='$object["orderStatus"] eq -2'>未付款
           <elseif condition='$object["orderStatus"] eq 0'/>未发货
           <elseif condition='$object["orderStatus"] eq 1'/>待签收
           <elseif condition='$object["orderStatus"] eq 2'/>已签收
           <elseif condition='$object["orderStatus"] eq -3'/>拒绝退款
           <elseif condition='$object["orderStatus"] eq 3'/>客户售后申请
           <elseif condition='$object["orderStatus"] eq 4'/>商家同意退款
           <elseif condition='$object["orderStatus"] eq 2'/>已退款
           <elseif condition='$object["orderStatus"] eq 6'/>订单完成
           </if>
        </span></td>
    </tr>
    <tr>
      <td style='font-weight:bold;'>订单日志</td>
    </tr>
    <tr>
      <td><table width='700'>
          <tr>
            <td width='220'>操作时间</td>
            <td width='350'>操作信息</td>
            <td width='230'>操作人</td>
          </tr>
          <volist name="object['log']" id="log">
            <tr>
              <td>{$log['logTime']}</td>
              <td>{$log['logContent']}</td>
              <td>
              	<if condition="empty($log['loginName'])">用户<else />Id:{$log['userId']}&nbsp;loginName:{$log['loginName']}</if>
              </td>
            </tr>
          </volist>
        </table></td>
    </tr>
    <tr>
      <td style='font-weight:bold;'>订单信息</td>
    </tr>
    <tr>
      <td><table width='700'>
          <tr>
            <td width='120' style='text-align:right'>支付方式：</td>
            <td>
            	<if condition='$object["payType"] eq 1'>余额支付
                <elseif condition='$object["payType"] eq 2' />支付宝支付
                <elseif condition='$object["payType"] eq 3' />微信支付</if>
            </td>
          </tr>
           
          <tr>
            <td style='text-align:right'>购买方式：</td>
            <td>
            	<if condition='$object["buyway"] eq 1'>直接购买
                <elseif condition='$object["buyway"] eq 2' />线下看货
                <elseif condition='$object["buyway"] eq 3' />监管发货</if>
            </td>
          </tr>
          <!--<tr>
            <td style='text-align:right'>买家留言：</td>
            <td>{$object['orderRemarks']}</td>
          </tr>-->
        </table></td>
    </tr>
    <if condition='$object["isRefund"] eq 1'>
      <tr>
        <td style='font-weight:bold;'>退款说明</td>
      </tr>
      <tr>
        <td><table width='700'>
            <tr>
              <td width='120' style='text-align:right'>说明：</td>
              <td> {$object['refundRemark']} </td>
            </tr>
          </table></td>
      </tr>
    </if>
    <if condition='$object["isInvoice"] eq 1'>
      <tr>
        <td style='font-weight:bold;'>发票信息</td>
      </tr>
      <tr>
        <td><table width='700'>
            <tr>
              <td width='120' style='text-align:right'>发票抬头：</td>
              <td> {$object['invoiceClient']} </td>
            </tr>
          </table></td>
      </tr>
    </if>
    <tr>
      <td style='font-weight:bold;'>收货人信息</td>
    </tr>
    <tr>
      <td><table width='700'>
          <tr>
            <td width='120' style='text-align:right'>收货人：</td>
            <td>{$object['userName']}</td>
          </tr>
          <tr>
            <td style='text-align:right'>地址：</td>
            <td>{$object['userAddress']}</td>
          </tr>
          <tr>
            <td style='text-align:right'>联系方式：</td>
            <td><notmpty name='object['userPhone']'> {$object['userPhone']} </notmpty>
              <notmpty name='object['userTel']'> {$object['userTel']} </notmpty></td>
          </tr>
        </table></td>
    </tr>
    <if condition="$object['buyway'] eq 2">
    <tr>
      <td style='font-weight:bold;'>线下看货门店</td>
    </tr>
    <tr>
      <td><table width='700'>
          <tr>
            <td width='120' style='text-align:right'>门店名称：</td>
            <td>{$object['lineStore']['storeName']}</td>
          </tr>
          <tr>
            <td style='text-align:right'>地址：</td>
            <td>{$object['lineStore']['province']}{$object['lineStore']['city']}{$object['lineStore']['district']}</td>
          </tr>
          <tr>
            <td style='text-align:right'>联系方式：</td>
            <td>{$object['lineStore']['storeTel']}</td>
          </tr>
        </table></td>
    </tr>
    </if>
    <tr>
      <td style='font-weight:bold;'>商品信息</td>
    </tr>
    <tr>
      <td><table>
          <tr>
            <td width='450' colspan='2'>商品</td>
            <td width='350'>价格</td>
            <td width='130'>数量</td>
            <td width='130'>总金额</td>
            <td width='130'>市场价格</td>
            <td width='130'>来源</td>
          </tr>
          <volist name="object['goodslist']" id="goods">
            <tr>
              <td width='50'><img src='__ROOT__/{$goods["goodsThumbs"]}' style='margin:2px;' width='50' height='50'/></td>
              <td width='400'>{$goods["goodsName"]}
                <if condition="$goods['goodsAttrName'] neq ''">【{$goods['goodsAttrName']}】</if></td>
              <td width='350'>￥{$goods["shopPrice"]}</td>
              <td width='130'>{$goods["goodsNumber"]}</td>
              <td width='130'>￥{$goods["shopPrice"]*$goods["goodsNumber"]}</td>
              <td width='130'>￥{$goods["marketPrice"]*$goods["goodsNumber"]}</td>
               
              <td width='130'>

               <if condition="$goods['isSource'] eq 1">转售<else/>非转售</if>
                </td>

            </tr>
          </volist>
        </table></td>
    </tr>
    <tr>
      <td style='text-align:right;padding-right:10px;'>商品总金额：￥{$object['totalMoney']}<br/>
        + 鉴定费：￥{$object['supPrice']}<br/>
        + 运费：￥{$object['supPostage']}<br/>
        <span style='font-weight:bold;font-size:20px'>订单金额：</span><span style='font-weight:bold;font-size:20px;color:red;'>￥{$object['totalMoney']+$object['supPrice']+$object['supPostage']}</span></td>
    </tr>
    <tr>
      <td style='font-weight:bold;'>平台发货</td>
    </tr>
    <tr>
      <td><table width='700'>
          <tr height="35px">
            <td width='120' style='text-align:right'>快递公司：</td>
            <td><select name="expressId" id="expressId">
            	<option value="0">请选择</option>
                <volist name="express" id="vo">
                <option value="{$vo.expressId}" <if condition="$vo['expressId'] == $object['expressId']">selected</if>>{$vo.expressName}</option>
                </volist>
            </select></td>
          </tr>
          <tr height="35px">
            <td style='text-align:right'>快递单号：</td>
            <td><input type="text" name="expressNo" id="expressNo" value="{$object['expressNo']}" /></td>
          </tr>
          <tr>
            <td style='text-align:right'>备注记录：</td>
            <td><textarea cols="60" rows="5" name="remark" id="remark"></textarea></td>
          </tr>
          <input type="hidden" id="orderStatus" value="{$object['orderStatus']}">
          <input type="hidden" id="orderId" value="{$object['orderId']}">
        </table></td>
    </tr>
    <tr>
      <td colspan='2' align='center'><button type="button" class="btn btn-success" onclick='deliverGoods()' style="margin-right:15px;">发&nbsp;货</button><button type="button" class="btn btn-primary" onclick='javascript:location.href="{$referer}"'>返&nbsp;回</button></td>
    </tr>
  </table>
</form>
<script type="text/javascript">
function deliverGoods(){
	var params = {};
	params.orderId = $.trim($('#orderId').val());
	params.expressId = $.trim($('#expressId').val());
	params.expressNo = $.trim($('#expressNo').val());
	params.remark = $.trim($('#remark').val());;
	params.orderStatus = $.trim($('#orderStatus').val());
	params.expressId = $.trim($('#expressId').val());
	//params.expressName = $('#expressId').find("option:selected").text();
	$.post("{:U('Admin/Orders/deliverGoods')}",params,function(data,textStatus){
	   var json = MXC.toJson(data);
		if(json.code=='1'){
			location.href= "{:U('Admin/Orders/index')}";
		}else{
			alert('提交失败!');
			window.location.reload();
		}
	});
}
</script>
</body>
</html>